load("//bzl:cpp_unittest.bzl", "cpp_unittest")

cpp_unittest(
    name = "async_trace_test",
    srcs = ["AsyncTraceTest.cpp"],
    deps = [
        "//folly/detail:async_trace",
        "//folly/portability:gtest",
    ],
)

cpp_unittest(
    name = "static_singleton_manager_test",
    srcs = ["StaticSingletonManagerTest.cpp"],
    deps = [
        "//folly/detail:static_singleton_manager",
        "//folly/lang:keep",
        "//folly/portability:gtest",
    ],
)

cpp_unittest(
    name = "unique_instance_test",
    srcs = ["UniqueInstanceTest.cpp"],
    deps = [
        "//folly:string",
        "//folly:traits",
        "//folly/detail:unique_instance",
        "//folly/portability:gtest",
    ],
)

cpp_unittest(
    name = "file_util_detail_test",
    srcs = [
        "FileUtilDetailTest.cpp",
    ],
    deps = [
        "//folly/detail:file_util_detail",
        "//folly/portability:gtest",
    ],
)

# Disabled because perf needs special permissions on the machine in order to run.
# cpp_unittest(
#     name = "perf_scoped_test",
#     srcs = [
#         "PerfScopedTest.cpp",
#     ],
#     deps = [
#         "//folly/detail:perf_scoped",
#         "//folly/portability:gmock",
#         "//folly/portability:gtest",
#         "//folly/portability:unistd",
#         "//folly/test:test_utils",
#     ],
# )

cpp_unittest(
    name = "simple_simd_string_utils_test",
    srcs = [
        "SimpleSimdStringUtilsTest.cpp",
    ],
    deps = [
        "//folly/algorithm/simd/detail:simd_platform",
        "//folly/detail:simple_simd_string_utils",
        "//folly/portability:gtest",
    ],
)

cpp_unittest(
    name = "split_string_simd_test",
    srcs = [
        "SplitStringSimdTest.cpp",
    ],
    deps = [
        "//folly:fbstring",
        "//folly:fbvector",
        "//folly:range",
        "//folly:small_vector",
        "//folly/detail:split_string_simd",
        "//folly/portability:gtest",
    ],
)

cpp_unittest(
    name = "thread_local_detail_test",
    srcs = [
        "ThreadLocalDetailTest.cpp",
    ],
    deps = [
        "//folly:synchronized",
        "//folly:thread_local",
        "//folly/portability:gtest",
        "//folly/synchronization/test:barrier",
    ],
)

cpp_unittest(
    name = "traponavx512_test_negative",
    srcs = ["TrapOnAvx512TestNegative.cpp"],
    deps = [
        "//folly/detail:traponavx512",
        "//folly/portability:gtest",
    ],
)

cpp_unittest(
    name = "detail_typelist_test",
    srcs = ["TypeListTest.cpp"],
    deps = [
        "//folly/detail:typelist",
        "//folly/portability:gtest",
    ],
)
